﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

public partial class MasterPage : System.Web.UI.MasterPage
{
    private Configuration _configuration;

    protected void Page_Load(object sender, EventArgs e)
    {        
        _configuration = Configuration.Instance;

        LoadMenus();
    }
    
    private void LoadMenus()
    {
        Menu.Items[1].ChildItems.Clear();
        foreach (string ev in _configuration.EventLogs)
        {
            MenuItem it = new MenuItem();
            it.Text = ev;
            it.NavigateUrl = string.Format("~/EventLogs/EventLogs.aspx?log={0}", ev);
            Menu.Items[1].ChildItems.Add(it);
        }
    }
}
